package com.yan.service.serviceImpl;

import com.yan.dao.StudentMapper;
import com.yan.dao.TeacherMapper;
import com.yan.pojo.Student;
import com.yan.pojo.Teacher;
import com.yan.service.TeacherService;

import java.util.List;

public class TeacherServiceImpl implements TeacherService {

    private StudentMapper studentMapper;
    private TeacherMapper teacherMapper;
    public void setStudentDao(StudentMapper studentMapper) {
        this.studentMapper = studentMapper;
    }
    public void setTeacherDao(TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }

    @Override
    public List<Teacher> getTeacherList() {
        return teacherMapper.getTeacherList();
    }

    @Override
    public List<Student> studentByTeacher(Integer teacherId) {
        return studentMapper.studentByTeacher(teacherId);
    }

    @Override
    public boolean updateStudent01(Student student) {
        return studentMapper.updateStudent01(student);
    }

    @Override
    public boolean addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public Teacher getTeacherById(Integer teacherId) {
        return teacherMapper.getTeacherById(teacherId);
    }

    @Override
    public boolean addStudentByTeacher(Student student) {
        return studentMapper.addStudentByTeacher(student);
    }

    @Override
    public boolean delStudentByStudentId(Integer studentId) {
        return studentMapper.delStudentByStudentId(studentId);
    }

    @Override
    public boolean updateTeacherPassword(Teacher teacher) {
        return teacherMapper.updatePassword(teacher);
    }

    @Override
    public List<Student> findStudent(String keyWords) {
        return studentMapper.findStudent(keyWords);
    }

    @Override
    public boolean addStuToTeacher(Integer studentId, Integer teacherId) {
        return studentMapper.addStuToTeacher(studentId, teacherId);
    }

    @Override
    public Integer isAbleToTeacher(Integer studentId, Integer teacherId) {
        return studentMapper.isAbleToTeacher(studentId, teacherId);
    }

    @Override
    public boolean removeClass(Integer studentId) {
        return studentMapper.removeClass(studentId);
    }

    @Override
    public Teacher getTeacherByName(String name) {
        return teacherMapper.getTeacherByName(name);
    }

}
